<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
  <div class="title shadow titleBg">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->categoryId}/{:$i->channelId}">添加</a>]</span></h1></td>
      </tr>
    </table>
  </div>
  <div class="content shadow">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <th scope="col">名称</th>
        <th scope="col">状态</th>
        <th scope="col">作者</th>
        <th scope="col">版本</th>
        <th scope="col">发布时间</th>
        <th scope="col">操作</th>
      </tr>
      {:foreach item=item from=$i->modules}<tr>
        <td>{:$item.name}</td>
        <td>{:if $item.isInstall}已安装 => <a href='#@' onclick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/uninstall/{:$item.hash}', '{:$smarty.const.BOOT_URL}/{:$i->c}/index');">卸载</a>{:else}未安装 => <a href='#@' onclick="getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/install/{:$item.hash}', '{:$smarty.const.BOOT_URL}/{:$i->c}/index/123');">安装</a>{:/if}</td>
        <td>{:$item.author}</td>
        <td>{:$item.version}</td>
        <td>{:$item.time|date_format:"%Y-%m-%d %H:%M"}</td>
        <td>
        <a href='{:$smarty.const.BOOT_URL}/{:$i->c}/export/mod/{:$item.hash}'>详情</a>
       | <a href='{:$smarty.const.BOOT_URL}/{:$i->c}/export/mod/{:$item.hash}'>修改</a>
       | <a href='#@'>删除</a></td>
      </tr>{:/foreach}       
      <tr>
        <td colspan="6" class="lightGreyBg textL">&nbsp;</td>
      </tr>
    </table>
  </div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function updateHtml(id)
{
	if(id == -1)
	{
		id = getSel('sel[]');
		if(id == '')
		{
			alert('您还没有选中要更新的记录');	
			return false;
		}
	}
	getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/updateHtml/'+id);	
}

function del(id, name)
{
	var ids='';
	
	if(name != undefined)
	{
		$("input:checked[name='"+name+"']").each(function(i){
			ids+=this.value+',';
		});
		ids = ids.substr(0,ids.length-1);
	}
	else if(id > 0)
	{
		ids = id;
	}
	
	if(ids.length==0)
	{
		alert('您还没有选中要删除的记录');
		return false;
	}
	
	if(confirm('确定要删除ID为'+ids+'的记录?'))
	{
		getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}/{:$i->p[3]}');
	}
	
	return false;
}
</script>
</body>
</html>
